<?
define("USO_CORRETO", true);
require("_superlibrary_.php");
################################################################################
# counter.php                                                                  #
################################################################################
# PHP Live Counter Script v1.0 ?2004 Carlos Barreto Feitoza Filho              #
# Script escrito por Carlos Barreto Feitoza Filho                              #
# Contato: carlos.b.feitoza.filho@gmail.com ou ICQ: 29391688 (Authorize)       #
# Dispon?vel em http://wildstarco.thefreebizhost.com - Se??o de downloads      #
# NOTA: Aceito sugest?es para melhorias, mas n?o aceitarei cr?ticas de nenhuma #
#       esp?cie! 8^)                                                           #
# ---------------------------------------------------------------------------- #
# NOME DO PROGRAMA: PHP Live Counter Script File                               #
# VERS?O: 1.0                                                                  #
# ?LTIMA MODIFICA??O: 19/09/2004                                               #
# ============================================================================ #
# INFORMA??ES DE COPYRIGHT:                                                    #
#                                                                              #
# Copyright (c)2003 Carlos Barreto Feitoza Filho. Todos os direitos reservados #
#                                                                              #
# Este programa ? gratuito; voc? pode modifica-lo como  quiser. Por?m, vers?es #
# modificadas n?o  podem ser  vendidas ou distribu?das. Voc? n?o pode  alterar #
# esta informa??o de copyright.                                                #
#                                                                              #
# GARANTIA LIMITADA:                                                           #
#                                                                              #
# ESTE  PROGRAMA  ?  DISTRIBU?DO  NO  INTUITO  DE  SER ?TIL, MAS SEM QUAISQUER #
# GARANTIAS; N?O ME RESPONSABILIZO POR QUAISQUER DANOS  OU  INCONVENIENTES QUE #
# ELE VENHA CAUSAR.                                                            #
################################################################################
################################################################################
# Constantes e Variaveis Globais                                               #
################################################################################
######################## Cria o arquivo se ele n?o existir #####################
define("_HITSFILE","hits.dat");
if (!file_exists(_HITSFILE)) {
    $FileResource = fopen(_HITSFILE,"w+");
    fwrite($FileResource, "0", 1);
    fclose($FileResource);
}
define("_HITSFILESIZE",filesize(_HITSFILE) > 0?filesize(_HITSFILE):1);

$FileResource = fopen(_HITSFILE,"r");

$FileContents = fread($FileResource, _HITSFILESIZE);

$FileContents = $FileContents?$FileContents:0;

if (!GetMyCookie("wildstarcorphitcount",true)) { //Se o cookie n?o existe ? porque ele j? expirou ou nunca foi setado, logo entre e conte o hit

    $FileContents++; //Incrementa o valor de $FileContents

    $FileResource = fopen(_HITSFILE,"w+");

    if (flock($FileResource, 2))
        fwrite($FileResource, $FileContents, strlen($FileContents));

    fclose($FileResource);
}

SetMyCookie("wildstarcorphitcount", $FileContents, true, 600);//Seta o cookie com um tempo de vida de 10 minutos = 600 segundos

$FinalText = JustifyNumber("0000000000000000",$FileContents);

echo <<< HTML
<html>
	<head>
		<title>:: Wildstar Corporation :: Counter Value ::</title>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<meta name="generator" content="Macromedia HomeSite 5.5">
		<meta http-equiv="Refresh" content="60">
		<link rel="stylesheet" type="text/css" href="../../estilos/black+gold.css" title="Esquema Dourado + Preto">
		<script language="JavaScript1.5" src="../javascript_lib/styleswitch.js" type="text/javascript"></script>
		<script src="../sistema[pt-br]/utilitarios/javascript_lib/comum.js" type="text/javascript"></script>
	</head>
	<body class="counter_value">
    $FinalText
	</body>
</html>
HTML;
?>